Chris Pollett >
Old Classses > |
HW#5 --- last modified February 07 2019 04:34:34..Due date: Dec 4
Files to be submitted: Purpose:To experiment with projective transformations and with textures. Related Course Outcomes: The main course outcomes covered by this assignment are: LO4 -- Use OpenGL clipping and viewport functions in both 2D and 3D. LO5 -- Write an OpenGL program that makes used of 2D or 3D affine transformations. LO6 -- Write an OpenGL program that makes use of lighting and different kinds of materials. Specification: For this homework I want you to experiment with projection matrices and materials. Your program should make a row of 11 trees arranged evenly along the x-axis, centered at the origin. The trees rest on the x-z plane which should be light green. As you know, a tree is a cylinder trunk made from a deep brown, wood-like material together with a sphere-like top made from a green, plastic material. In addition, it typically has red apples made of a distinct material of your choice different from these two. Five units above the tree of largest x-value you should place a light source. Your camera should initially be placed along the positive z-axis so that the field of view is exactly all eleven trees. The aspect ratio should be set so that the tops and bottoms of the trees occupy the whole viewable vertical direction of the drawn scene. If `z` is the distance of the nearest tree to the camera, then you should set near so that it is `z/2` from the camera in the same direction and far should be at `3z/2`. Your program should have three modes. If you hit the letter `a` you enter aspect mode. Hitting the minus and plus keys will then increase or decrease the aspect ratio. If you hit the letter `f`, then hitting the minus and plus keys will increase or decrease the field of view. Hitting the `z` key will z-axis mode. Hitting the minus and plus keys will then move the user forward or backward along the z-axis, the distance to near and far with respect to the camera should remain constant. Appropriate clipping should occur if one gets to far from or near to the trees. In addition to the above, in front of your forest lurks a scary monster known as the Gratuitous Triangle. It is an equilateral triangle a quarter as tall as a tree placed visible somewhere on the ground so that its front face is facing the camera. Hitting the letter `b` causes it to turn 180 degrees about the y-axis so that its back faces the camera, and so that it should be culled if we enable culling. Repeatedly hitting `b` toggles this 180 degree rotation. Point Breakdown
|